cmake_minimum_required(VERSION 3.7...3.27)

project("NAME"
        DESCRIPTION "DESC"
        VERSION "1.0.0"
        LANGUAGES CXX)

if (DEFINED CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
elseif(DEFINED CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE STREQUAL "Release")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
endif()

set(CMAKE_C_STANDARD 23)
set(CMAKE_CXX_STANDARD 23)

include_directories(inc)
add_subdirectory(src)
add_subdirectory(modules)

string(TIMESTAMP BUILD_TIMESTAMP "%Y-%m-%d %H:%M:%S")
message(STATUS "Build TimeStamp = ${BUILD_TIMESTAMP}")
message(STATUS "System Name = ${CMAKE_SYSTEM_NAME}")
message(STATUS "System Processor = ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "C Compiler(F) = ${CMAKE_C_COMPILER}${CMAKE_C_FLAGS}")
message(STATUS "C++ Compiler(F) = ${CMAKE_CXX_COMPILER}${CMAKE_CXX_FLAGS}")
message(STATUS "Assembler = ${CMAKE_ASM_COMPILER}")
message(STATUS "Linker = ${CMAKE_LINKER}")
message(STATUS "Archiver = ${CMAKE_AR}")
message(STATUS "Make Program = ${CMAKE_MAKE_PROGRAM}")
message(STATUS "Project Name = ${CMAKE_PROJECT_NAME}")
message(STATUS "Project Version = ${CMAKE_PROJECT_VERSION}")
message(STATUS "Project Build Type = ${CMAKE_BUILD_TYPE}")
message(STATUS "Project Source Path = ${CMAKE_SOURCE_DIR}")
message(STATUS "C Language Standard = ${CMAKE_C_STANDARD}")
message(STATUS "CXX Language Standard = ${CMAKE_CXX_STANDARD}")
message(STATUS "Binary OutPut Path = ${PROJECT_BINARY_DIR}/${EXECUTABLE_OUTPUT_PATH}")
message(STATUS "Library Output Path = ${PROJECT_BINARY_DIR}/${LIBRARY_OUTPUT_PATH}")
message(STATUS "Install Path = ${CMAKE_INSTALL_PREFIX}")
